<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_shipping_area.*" %>
<%@page import="java.util.*" %>
<html>
  <head>
    
    <title>配送区域设置</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="shipping_area.js"></script> 
</head>

<body>

  <% 
  	String shipping_area_id="";
  	if(request.getParameter("shipping_area_id")!=null) shipping_area_id = request.getParameter("shipping_area_id");
  	Ti_shipping_areaInfo ti_shipping_areaInfo = new Ti_shipping_areaInfo();
  	List list = ti_shipping_areaInfo.getListByPk(shipping_area_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String shipping_area_name="",shipping_id="",area_id="",cal_type="",one_fare="",first_fare="",con_fare="",free_fare="",arrive_fare="",in_date="";
  	if(map.get("shipping_area_name")!=null) shipping_area_name = map.get("shipping_area_name").toString();
  	if(map.get("shipping_id")!=null) shipping_id = map.get("shipping_id").toString();
  	if(map.get("area_id")!=null) area_id = map.get("area_id").toString();
  	if(map.get("cal_type")!=null) cal_type = map.get("cal_type").toString();
  	if(map.get("one_fare")!=null) one_fare = map.get("one_fare").toString();
  	if(map.get("first_fare")!=null) first_fare = map.get("first_fare").toString();
  	if(map.get("con_fare")!=null) con_fare = map.get("con_fare").toString();
  	if(map.get("free_fare")!=null) free_fare = map.get("free_fare").toString();
  	if(map.get("arrive_fare")!=null) arrive_fare = map.get("arrive_fare").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
    Ti_shipping_areaInfo areainfo = new Ti_shipping_areaInfo();
    String selectname =areainfo.getareanameSelectItem(area_id);
  %>
	
	<h1>修改配送区域设置</h1>
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="15%">
				请选择地区:<font color="red">*</font>
			</td>
			<td colspan="3"><select name="area_id" id="area_id" style="width:80px;">
					  <option value="">请选择</option>
					  <%=selectname%>
				</select></td>
		</tr>
		
		<tr>
			<td align="right" width="10%" >
				计算方式:
			</td>
			<td colspan="3"><input name="cal_type" id="cal_type" type="radio" value="0" <%if(cal_type.equals("0")) out.print("checked");%> onclick="checkvalue(0)" />按重量计算
			<input name="cal_type" id="cal_type" type="radio" value="1" <%if(cal_type.equals("1") ) out.print("checked");%> onclick="checkvalue(1)" />按商品件数计算</td>
		</tr>
		<tr >
			<td align="right" width="10%">
				单件费用:<font color="red">*</font>
			</td>
			<td colspan="3"><input name="one_fare" id="one_fare" type="text" value="<%=one_fare%>" size="5" maxlength="5" onkeyup="if(isNaN(this.value))this.value=''" onBlur="this.value=trim(value)"/>元</td>
		</tr>
		
		<tr >
			<td align="right" width="10%" >
				首重费用:<font color="red">*</font>
			</td>
			<td><input name="first_fare" id="first_fare" type="text"  value="<%=first_fare%>" size="5" maxlength="5" onkeyup="if(isNaN(this.value))this.value=''" onBlur="this.value=trim(value)"/>元</td>
			<td align="right" width="10%">
				续重费用:<font color="red">*</font>
			</td>
			<td><input name="con_fare" id="con_fare" type="text" value="<%=con_fare%>" size="5" maxlength="5" onkeyup="if(isNaN(this.value))this.value=''" onBlur="this.value=trim(value)"/>元</td>
		</tr>
		
		<tr>
			<td align="right" width="10%" >
				免费额度:
			</td>
			<td colspan="3"><input name="free_fare" id="free_fare" type="text"  value="<%=free_fare%>" size="5" maxlength="5" onkeyup="if(isNaN(this.value))this.value=''" onBlur="this.value=trim(value)"/>元</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="4253" />
				<input type="hidden" name="arrive_fare" value="<%=arrive_fare %>" />
				
				<input name="shipping_area_name" id="shipping_area_name" type="hidden" value="<%=shipping_area_name%>"  readonly="readonly"/>
	  			<input type="hidden" name="shipping_area_id" value="<%=shipping_area_id %>" />
	  			<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="return checkInfo();" />&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='shipping_areaindex.jsp?shipping_id=<%=shipping_id%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
